/**
 * 
 */
package domain;

/**
 * @author grupo22
 *
 */
public class Laptop extends Computer {
	
	private int autonomy;
	private double weight;
	
	public Laptop(String brand, String model, double price, Article article,
			Supplier supplier, String processor, int memory, int disc,
			double display, boolean guadalinexComp, int autonomy, double weight) {
		super(brand, model, price, article, supplier, processor, memory, disc,
				display, guadalinexComp);
		this.autonomy = autonomy;
		this.weight = weight;
	}

	public int getAutonomy() {
		return autonomy;
	}

	public void setAutonomy(int autonomy) {
		this.autonomy = autonomy;
	}

	public double getWeight() {
		return weight;
	}

	public void setWeight(double weight) {
		this.weight = weight;
	}
	
	public void doValidate() {
		if (autonomy >= 480 && weight <= 3.0) {
			super.setValid(true);
		} else {
			super.setValid(false);
		}
		super.setValidate(true);
	}
	
	public void doContract(){
		if (this.isValid()){
			super.setContracted(true);
		}
	}

}
